F1 Layout

Map indicates the layout of the F1 generation resulting from a cross between EC201 and EC103 parents.

Map of F1 Trees

“Map of F1 Trees”

Height Diagram

Diagram indicates the areas of leaf collection regarding height. Each Tree had 10 leaves collected, 3 from Low, 4 from Mid and 3 from High. The first leaf sampled was measured twice for replication comparison.

Diagram of leaf collection levels

“Diagram of leaf collection levels”

Import and Arrange Data

“Full.xlsx” contains measurement information from sampling. Sheet “Dup” contains only the repeated leaf measures

# Import Data Measures
Data <-read.xlsx("Full.xlsx", sheetName ="Full")
head(Data)
##   Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 1              4         CG     0      0   0    20       OG      CG    N
## 2              4         CG     0      0   0    20       OG      CG    N
## 3              4         CG     0      0   0    20       OG      CG    N
## 4              4         CG     0      0   0    20       OG      CG    N
## 5              4         CG     0      0   0    20       OG      CG    N
## 6              4         CG     0      0   0    20       OG      CG    N
##   measure Height    Chl  Flav  Anth   NBI
## 1       9      H 28.220 2.418 0.205 11.67
## 2       3      L 27.958 2.298 0.691 12.17
## 3      11      H 33.727 2.458 0.527 13.72
## 4       4      L 25.938 1.758 0.172 14.76
## 5      10      H 36.205 2.283 0.270 15.86
## 6       6      M 34.332 2.115 0.150 16.23
# Import Replicate Data
Dup <-read.xlsx("Full.xlsx", sheetName ="Dup")
head(Data)
##   Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 1              4         CG     0      0   0    20       OG      CG    N
## 2              4         CG     0      0   0    20       OG      CG    N
## 3              4         CG     0      0   0    20       OG      CG    N
## 4              4         CG     0      0   0    20       OG      CG    N
## 5              4         CG     0      0   0    20       OG      CG    N
## 6              4         CG     0      0   0    20       OG      CG    N
##   measure Height    Chl  Flav  Anth   NBI
## 1       9      H 28.220 2.418 0.205 11.67
## 2       3      L 27.958 2.298 0.691 12.17
## 3      11      H 33.727 2.458 0.527 13.72
## 4       4      L 25.938 1.758 0.172 14.76
## 5      10      H 36.205 2.283 0.270 15.86
## 6       6      M 34.332 2.115 0.150 16.23
#Isolate Crimson Glory Outgroup
CG = Data[c(1:11),]
head(CG)
##   Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 1              4         CG     0      0   0    20       OG      CG    N
## 2              4         CG     0      0   0    20       OG      CG    N
## 3              4         CG     0      0   0    20       OG      CG    N
## 4              4         CG     0      0   0    20       OG      CG    N
## 5              4         CG     0      0   0    20       OG      CG    N
## 6              4         CG     0      0   0    20       OG      CG    N
##   measure Height    Chl  Flav  Anth   NBI
## 1       9      H 28.220 2.418 0.205 11.67
## 2       3      L 27.958 2.298 0.691 12.17
## 3      11      H 33.727 2.458 0.527 13.72
## 4       4      L 25.938 1.758 0.172 14.76
## 5      10      H 36.205 2.283 0.270 15.86
## 6       6      M 34.332 2.115 0.150 16.23
#Isolate East Cape 201 Parent
EC201 = Data[c(12:21),]
head(EC201)
##    Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 12              4      EC201     0      0   0    18       P1   EC201    N
## 13              4      EC201     0      0   0    18       P1   EC201    N
## 14              4      EC201     0      0   0    18       P1   EC201    N
## 15              4      EC201     0      0   0    18       P1   EC201    N
## 16              4      EC201     0      0   0    18       P1   EC201    N
## 17              4      EC201     0      0   0    18       P1   EC201    N
##    measure Height    Chl  Flav  Anth   NBI
## 12       9      H 30.722 2.138 0.156 14.37
## 13       6      M 45.272 1.861 0.075 24.33
## 14      10      H 46.174 1.868 0.052 24.72
## 15       8      M 57.480 1.897 0.037 30.30
## 16       5      M 57.752 1.681 0.125 34.35
## 17       3      L 54.927 1.592 0.061 34.50
#Isolate East Cape 103 Parent
EC103 = Data[c(22:33),]
head(EC103)
##    Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 22              4      EC103     0      0   0    19       P2   EC103    N
## 23              4      EC103     0      0   0    19       P2   EC103    N
## 24              4      EC103     0      0   0    19       P2   EC103    N
## 25              4      EC103     0      0   0    19       P2   EC103    N
## 26              4      EC103     0      0   0    19       P2   EC103    N
## 27              4      EC103     0      0   0    19       P2   EC103    N
##    measure Height    Chl  Flav  Anth   NBI
## 22       8      M 31.471 1.324 0.018 23.77
## 23      11      H 57.349 2.111 0.053 27.17
## 24       4      L 43.949 1.478 0.004 29.73
## 25      12      H 56.779 1.846 0.108 30.75
## 26       9      M 55.916 1.746 0.055 32.03
## 27      10      H 57.809 1.746 0.054 33.11
#Isolate Offspring from Parental Cross
F1 = Data[c(34:1825),]
head(F1)
##    Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 34              1         F1     1      1   1    15        1   IN4BT    N
## 35              1         F1     1      1   1    15        1   IN4BT    N
## 36              1         F1     1      1   1    15        1   IN4BT    N
## 37              1         F1     1      1   1    15        1   IN4BT    N
## 38              1         F1     1      1   1    15        1   IN4BT    N
## 39              1         F1     1      1   1    15        1   IN4BT   Y1
##    measure Height    Chl  Flav  Anth   NBI
## 34       8      M  3.268 1.958 0.143  1.67
## 35       2      L 23.326 2.581 0.065  9.04
## 36      11      M 24.682 2.265 0.112 10.90
## 37       7      M 27.068 2.229 0.084 12.14
## 38      14      H 27.459 2.135 0.138 12.86
## 39       3      L 34.592 2.583 0.048 13.39

Checking Similarity of Replicates

Replicates were taken by measuring the first leaf sample of a tree twice, in order to establish consistency and reliability of measurements

R <-group_by(Data,Rep.)
SR <-summarise(R,count = n(), Chl = mean(Chl,na.rm =T), NBI = mean(NBI, na.rm=T), Anth = mean(Anth, ra.rm = T), Flav = mean(Flav, na.rm = T))

#Mean Calculations Across All Replicate Measures
#Chlorophyll
RC = mean(SR$Chl);RC
## [1] 35.54518
#Nitrogen Index
RN = mean(SR$NBI);RN
## [1] 18.58057
#Anthocyanin
RA = mean(SR$Anth);RA
## [1] 0.09788557
#Flavanoids
RF = mean(SR$Flav);RF
## [1] 1.966022
#Plots of Replicate Group Medians and Distributions
plot<- ggplot(Dup) + aes(x = Rep., y = Chl ) + geom_boxplot()+geom_hline(yintercept = RC)
plot2<- ggplot(Dup) + aes(x = Rep., y = NBI ) + geom_boxplot()+geom_hline(yintercept = RN)
plot3<- ggplot(Dup) + aes(x = Rep., y = Anth ) + geom_boxplot()+geom_hline(yintercept = RA)
plot4<- ggplot(Dup) + aes(x = Rep., y = Flav ) + geom_boxplot()+geom_hline(yintercept = RF)

grid.arrange(plot,plot2,plot3,plot4, ncol = 4)

#ANOVA
#Chlorophyll
mod <-lm(Dup$Chl ~ Dup$Rep.)
anova(mod)
## Analysis of Variance Table
## 
## Response: Dup$Chl
##            Df Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep.    1    218  218.33   1.033 0.3102
## Residuals 314  66366  211.36
#Flavanol
mod2 <-lm(Dup$Flav ~ Dup$Rep.)
anova(mod2)
## Analysis of Variance Table
## 
## Response: Dup$Flav
##            Df  Sum Sq  Mean Sq F value Pr(>F)
## Dup$Rep.    1  0.0521 0.052129  0.6506 0.4205
## Residuals 314 25.1596 0.080126
#Anthocyanin
mod3 <-lm(Dup$Anth ~ Dup$Rep.)
anova(mod3)
## Analysis of Variance Table
## 
## Response: Dup$Anth
##            Df  Sum Sq   Mean Sq F value Pr(>F)
## Dup$Rep.    1 0.00003 0.0000304  0.0151 0.9023
## Residuals 314 0.63303 0.0020160
#Nitrogen
mod4 <-lm(Dup$NBI ~ Dup$Rep.)
anova(mod4)
## Analysis of Variance Table
## 
## Response: Dup$NBI
##            Df  Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep.    1    82.5  82.530   1.115 0.2918
## Residuals 314 23241.0  74.016

Comparing Allocations

Allocation refers to which group measurements were taken from, i.e. Parental Tree (EC103, EC201), Outgroup Tree (CG), F1 Cross offspring

Al <-group_by(Data,Allocation)
SAL <-summarise(Al,count = n(), Chl = mean(Chl,na.rm =T), NBI = mean(NBI, na.rm=T), Anth = mean(Anth, ra.rm = T), Flav = mean(Flav, na.rm = T))

#Mean Calculations Across all Allocations
#Chlorophyll
AlC = mean(SAL$Chl);AlC
## [1] 44.05587
#Nitrogen
AlN = mean(SAL$NBI);AlN
## [1] 24.93871
#Flavanoids
AlF = mean(SAL$Flav);AlF
## [1] 1.861773
#Anthocyanin
AlA = mean(SAL$Anth);AlA
## [1] 0.122872
#Boxplot comparing medians and measurement distributions
plot5<- ggplot(Data) + aes(x = Allocation, y = Chl) + geom_boxplot()+geom_hline(yintercept = AlC)
plot6<- ggplot(Data) + aes(x = Allocation, y = NBI) + geom_boxplot()+geom_hline(yintercept = AlN)
plot7<- ggplot(Data) + aes(x = Allocation, y = Flav) + geom_boxplot()+geom_hline(yintercept = AlF)
plot8<- ggplot(Data) + aes(x = Allocation, y = Anth) + geom_boxplot()+geom_hline(yintercept = AlA)

grid.arrange(plot5,plot6,plot7,plot8, ncol=2)

#ANOVAs
#Chlorophyll
mod5 <-lm(Data$Chl ~ Data$Allocation)
anova(mod5)
## Analysis of Variance Table
## 
## Response: Data$Chl
##                   Df Sum Sq Mean Sq F value    Pr(>F)    
## Data$Allocation    3   6742 2247.21  9.9149 1.748e-06 ***
## Residuals       1821 412728  226.65                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Nitrogen
mod6 <-lm(Data$NBI ~ Data$Allocation)
anova(mod5)
## Analysis of Variance Table
## 
## Response: Data$Chl
##                   Df Sum Sq Mean Sq F value    Pr(>F)    
## Data$Allocation    3   6742 2247.21  9.9149 1.748e-06 ***
## Residuals       1821 412728  226.65                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Flavanol
mod7 <-lm(Data$Flav ~ Data$Allocation)
anova(mod7)
## Analysis of Variance Table
## 
## Response: Data$Flav
##                   Df  Sum Sq Mean Sq F value    Pr(>F)    
## Data$Allocation    3   2.713 0.90423  14.755 1.708e-09 ***
## Residuals       1821 111.598 0.06128                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Anthocyanin
mod8 <-lm(Data$Anth ~ Data$Allocation)
anova(mod8)
## Analysis of Variance Table
## 
## Response: Data$Anth
##                   Df Sum Sq  Mean Sq F value    Pr(>F)    
## Data$Allocation    3 0.3040 0.101343  47.474 < 2.2e-16 ***
## Residuals       1821 3.8873 0.002135                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

F1 Trees

Investigating measures across the F1 cross population

O <-group_by(F1,Tree.ID)
SO <-summarise(O,count = n(), Chl = mean(Chl,na.rm =T), NBI = mean(NBI, na.rm=T), Anth = mean(Anth, ra.rm = T), Flav = mean(Flav, na.rm = T));SO
## # A tibble: 159 x 6
##    Tree.ID count   Chl   NBI   Anth  Flav
##    <fct>   <int> <dbl> <dbl>  <dbl> <dbl>
##  1 IN4BT      26  34.5  16.2 0.110   2.17
##  2 IN4BV      11  27.5  13.8 0.121   2.01
##  3 IN4BW      11  24.8  12.5 0.127   1.99
##  4 IN4BX      11  37.6  18.4 0.0905  2.05
##  5 IN4BY      10  24.2  12.5 0.110   1.98
##  6 IN4BZ      11  32.0  15.6 0.106   2.09
##  7 IN4C0      11  28.0  13.4 0.139   2.04
##  8 IN4C1      11  30.8  15.1 0.118   2.04
##  9 IN4C2      11  42.6  21.2 0.0878  2.04
## 10 IN4C3      11  25.7  14.1 0.106   1.97
## # ... with 149 more rows

Chlorophyll

#Mean
OC <- mean(SO$Chl);OC
## [1] 35.13564
#Individual Tree Measures
plot15<-ggplot(O) + aes(x = Tree.ID, y = Chl, group_by(Tree.ID)) + geom_boxplot() +geom_hline(yintercept = OC)

#Measure Distribution
plot16<-ggplot(O) + aes(x = Chl) + geom_histogram()
grid.arrange(plot15,plot16)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

#ANOVA
ModChl <- lm(O$Chl ~ O$Tree.ID)
anova(ModChl)
## Analysis of Variance Table
## 
## Response: O$Chl
##             Df Sum Sq Mean Sq F value   Pr(>F)   
## O$Tree.ID  158  47130  298.29  1.3395 0.004474 **
## Residuals 1633 363634  222.68                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Flavanol

OF <- mean(SO$Flav);OF
## [1] 1.965265
plot17<-ggplot(O) + aes(x = Tree.ID, y = Flav) + geom_boxplot() +geom_hline(yintercept = OF)
plot18 <-ggplot(O) + aes(x = Flav) + geom_histogram()
grid.arrange(plot17,plot18)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ModFlav <- lm(O$Flav ~ O$Tree.ID)
anova(ModFlav)
## Analysis of Variance Table
## 
## Response: O$Flav
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## O$Tree.ID  158 25.118 0.15897  3.0531 < 2.2e-16 ***
## Residuals 1633 85.030 0.05207                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Anthocyanin

OA <- mean(SO$Anth);OA
## [1] 0.09699261
plot19<-ggplot(O) + aes(x = Tree.ID, y = Anth) + geom_boxplot() +geom_hline(yintercept = OA)
plot20<-ggplot(O) + aes(x = Anth) + geom_histogram()
grid.arrange(plot19,plot20)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ModAnth <- lm(O$Anth ~ O$Tree.ID)
anova(ModAnth)
## Analysis of Variance Table
## 
## Response: O$Anth
##             Df Sum Sq   Mean Sq F value    Pr(>F)    
## O$Tree.ID  158 0.5253 0.0033247  1.8093 2.001e-08 ***
## Residuals 1633 3.0007 0.0018376                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Nitrogen Status

#Mean
ON <- mean(SO$NBI);ON
## [1] 18.27171
plot21<-ggplot(O) + aes(x = Tree.ID, y = NBI) + geom_boxplot() +geom_hline(yintercept = ON)
plot22<-ggplot(O) + aes(x = NBI) + geom_histogram()
grid.arrange(plot21,plot22)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ModNBI <- lm(O$NBI ~ O$Tree.ID)
anova(ModNBI)
## Analysis of Variance Table
## 
## Response: O$NBI
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## O$Tree.ID  158  16378 103.661  1.5147 8.435e-05 ***
## Residuals 1633 111761  68.439                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Comparing Measures from the 3 height categories

Hgt <- group_by(F1, Height)
SHgt=summarise(Hgt, count = n(), Chl = mean(Chl,na.rm=T), NBI = mean(NBI, na.rm = T), Anth = mean(Anth, na.rm = T), Flav = mean(Flav, na.rm = T))

#Overall means across all heights
#Chlorophyll
HC = mean(SHgt$Chl);HC
## [1] 34.91248
#Nitrogen
HN = mean(SHgt$NBI);HN
## [1] 18.15982
#Anthocyanin
HA = mean(SHgt$Anth);HA
## [1] 0.09770524
#Flavanoids
HF = mean(SHgt$Flav);HF
## [1] 1.96426
#Boxplots visualising height comparisons
plot23<-ggplot(Hgt) + aes(x = Height, y = NBI) + geom_boxplot()+geom_hline(yintercept = HN)
plot24<-ggplot(Hgt) + aes(x = Height, y = Chl) + geom_boxplot()+geom_hline(yintercept = HC)
plot25<-ggplot(Hgt) + aes(x = Height, y = Flav) + geom_boxplot()+geom_hline(yintercept = HF)
plot26<-ggplot(Hgt) + aes(x = Height, y = Anth) + geom_boxplot()+geom_hline(yintercept = HA)
grid.arrange(plot23,plot24,plot25,plot26,ncol=2)

#Visualising Measurement Distributions
plot231<-ggplot(Hgt) + aes(x = Chl) + geom_histogram()
plot241<-ggplot(Hgt) + aes(x = NBI) + geom_histogram()
plot251<-ggplot(Hgt) + aes(x = Flav) + geom_histogram()
plot261<-ggplot(Hgt) + aes(x = Anth) + geom_histogram()
grid.arrange(plot231,plot241,plot251,plot261)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

#ANOVA
#Chlorophyll
FitH <- lm(Hgt$Chl ~ Hgt$Height)
anova(FitH)
## Analysis of Variance Table
## 
## Response: Hgt$Chl
##              Df Sum Sq Mean Sq F value Pr(>F)
## Hgt$Height    2    853  426.30  1.8605 0.1559
## Residuals  1789 409911  229.13
#Nitrogen
FitH2 <- lm(Hgt$NBI ~ Hgt$Height)
anova(FitH2)
## Analysis of Variance Table
## 
## Response: Hgt$NBI
##              Df Sum Sq Mean Sq F value Pr(>F)
## Hgt$Height    2    100  50.044  0.6992 0.4971
## Residuals  1789 128039  71.570
#Flavanoids
FitH3 <- lm(Hgt$Flav ~ Hgt$Height)
anova(FitH3)
## Analysis of Variance Table
## 
## Response: Hgt$Flav
##              Df  Sum Sq Mean Sq F value    Pr(>F)    
## Hgt$Height    2   0.915 0.45758  7.4943 0.0005739 ***
## Residuals  1789 109.232 0.06106                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Anthocyanin
FitH4 <- lm(Hgt$Anth ~ Hgt$Height)
anova(FitH4)
## Analysis of Variance Table
## 
## Response: Hgt$Anth
##              Df Sum Sq   Mean Sq F value    Pr(>F)    
## Hgt$Height    2 0.0526 0.0262759  13.533 1.468e-06 ***
## Residuals  1789 3.4735 0.0019416                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlations Between Measures

Comparing correlations between the various measures

Data2 = Data[c(12:15)]
cor(Data2)
##             Chl       Flav       Anth        NBI
## Chl   1.0000000 -0.1060143 -0.3038865  0.9468570
## Flav -0.1060143  1.0000000  0.1845141 -0.3865972
## Anth -0.3038865  0.1845141  1.0000000 -0.3204378
## NBI   0.9468570 -0.3865972 -0.3204378  1.0000000
plot9 <-ggplot(F1) + aes(x = Chl, y = Anth) + geom_point()
plot10 <-ggplot(F1) + aes(x = NBI, y = Anth) + geom_point()
plot11<-ggplot(F1) + aes(x = Flav, y = Anth) + geom_point()
plot12<-ggplot(F1) + aes(x = NBI, y = Chl) + geom_point()
plot13<-ggplot(F1) + aes(x = Flav, y = Chl) + geom_point()
plot14<-ggplot(F1) + aes(x = Flav, y = NBI) + geom_point()
grid.arrange(plot9,plot10,plot11,plot12,plot13,plot14)

comp <-lm(Flav ~ Anth, data = F1)
anova(comp)
## Analysis of Variance Table
## 
## Response: Flav
##             Df  Sum Sq Mean Sq F value    Pr(>F)    
## Anth         1   2.897 2.89687  48.348 4.983e-12 ***
## Residuals 1790 107.251 0.05992                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp2 <-lm(NBI ~ Anth, data = F1)
anova(comp2)
## Analysis of Variance Table
## 
## Response: NBI
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## Anth         1  14102 14101.7  221.35 < 2.2e-16 ***
## Residuals 1790 114037    63.7                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp3 <-lm(Flav ~ NBI, data = F1)
anova(comp3)
## Analysis of Variance Table
## 
## Response: Flav
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## NBI          1 14.948 14.9476  281.05 < 2.2e-16 ***
## Residuals 1790 95.200  0.0532                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp4 <-lm(Flav ~ Anth+NBI, data = F1)
anova(comp4)
## Analysis of Variance Table
## 
## Response: Flav
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## Anth         1  2.897  2.8969  54.551 2.311e-13 ***
## NBI          1 12.248 12.2485 230.653 < 2.2e-16 ***
## Residuals 1789 95.002  0.0531                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp5 <-lm(Anth ~ Flav + NBI, data = F1)
anova(comp5)
## Analysis of Variance Table
## 
## Response: Anth
##             Df  Sum Sq  Mean Sq F value    Pr(>F)    
## Flav         1 0.09273 0.092735  52.979 5.026e-13 ***
## NBI          1 0.30182 0.301822 172.429 < 2.2e-16 ***
## Residuals 1789 3.13148 0.001750                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp6 <-lm(NBI ~ Flav + Anth, data = F1)
anova(comp6)
## Analysis of Variance Table
## 
## Response: NBI
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## Flav         1  17389 17389.2  307.97 < 2.2e-16 ***
## Anth         1   9736  9736.0  172.43 < 2.2e-16 ***
## Residuals 1789 101014    56.5                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Column Block Effects

Cmn <- group_by(F1, Column)
SCmn <- summarise(Cmn, count =n(),Chl = mean(Chl,na.rm=T), NBI = mean(NBI, ra.nm = T), Anth = mean(Anth, na.rm=T),Flav = mean(Flav,na.rm =T))

CA = mean(SCmn$Anth);CA
## [1] 0.09596523
CC = mean(SCmn$Chl);CC
## [1] 34.87978
CN = mean(SCmn$NBI);CN
## [1] 18.30061
CF = mean(SCmn$Flav);CF
## [1] 1.947604
plot27<-ggplot(F1) + aes(x = Column, y = Anth,group = Column) + geom_boxplot()+geom_hline(yintercept = CA)

plot28<-ggplot(F1) + aes(x = Column, y = Flav,group = Column) + geom_boxplot() +geom_hline(yintercept = CF)

plot29<-ggplot(F1) + aes(x = Column, y = NBI,group = Column) + geom_boxplot() +geom_hline(yintercept = CN)

plot30<-ggplot(F1) + aes(x = Column, y = Chl,group = Column) + geom_boxplot() +geom_hline(yintercept = CC)

grid.arrange(plot27,plot28,plot29,plot30)

Col <- lm(Cmn$Anth ~ Cmn$Column)
anova(Col)
## Analysis of Variance Table
## 
## Response: Cmn$Anth
##              Df Sum Sq   Mean Sq F value Pr(>F)
## Cmn$Column    1 0.0011 0.0011069  0.5621 0.4535
## Residuals  1790 3.5249 0.0019692
Col2 <- lm(Cmn$Flav ~ Cmn$Column)
anova(Col2)
## Analysis of Variance Table
## 
## Response: Cmn$Flav
##              Df  Sum Sq Mean Sq F value    Pr(>F)    
## Cmn$Column    1   1.523 1.52276  25.093 6.001e-07 ***
## Residuals  1790 108.625 0.06068                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Col3 <- lm(Cmn$NBI ~ Cmn$Column)
anova(Col3)
## Analysis of Variance Table
## 
## Response: Cmn$NBI
##              Df Sum Sq Mean Sq F value   Pr(>F)   
## Cmn$Column    1    611  610.85   8.574 0.003453 **
## Residuals  1790 127528   71.24                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Col4 <- lm(Cmn$Chl ~ Cmn$Column)
anova(Col4)
## Analysis of Variance Table
## 
## Response: Cmn$Chl
##              Df Sum Sq Mean Sq F value  Pr(>F)  
## Cmn$Column    1    826  826.31  3.6081 0.05766 .
## Residuals  1790 409938  229.02                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Row Block Effects

Rw <-group_by(F1, Row)
SRw =summarise(Rw, count = n(), Chl = mean(Chl, na.rm=T),NBI = mean(NBI, na.rm=T), Flav = mean(Flav, na.rm = T), Anth = mean(Anth, na.rm=T))

#Means
#Chlorophyll
RwC = mean(SRw$Chl);RwC
## [1] 34.93729
#Anthocyanin
RwA = mean(SRw$Anth);RwA
## [1] 0.09720837
#Flavanoid
RwF = mean(SRw$Flav);RwF
## [1] 1.965176
#Nitrogen
RwN = mean(SRw$NBI);RwN
## [1] 18.17205
#Comparing Tree Measures
plot31<-ggplot(Rw) + aes(x = Row, y = Chl, group = Row) + geom_boxplot()  +geom_hline(yintercept = RwC);plot31

plot32<-ggplot(Rw) + aes(x = Row, y = Anth, group = Row) + geom_boxplot() +geom_hline(yintercept = RwA);plot32

plot33<-ggplot(Rw) + aes(x = Row, y = Flav,group = Row) + geom_boxplot() +geom_hline(yintercept = RwF);plot33

plot34<-ggplot(Rw) + aes(x = Row, y = NBI, group = Row) + geom_boxplot() +geom_hline(yintercept = RwN);plot34

#ANOVA
#Anthocyanin
Ro <- lm(Rw$Anth ~ Rw$Row)
anova(Ro)
## Analysis of Variance Table
## 
## Response: Rw$Anth
##             Df Sum Sq   Mean Sq F value    Pr(>F)    
## Rw$Row      49 0.2346 0.0047878  2.5339 4.261e-08 ***
## Residuals 1742 3.2914 0.0018895                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Nitrogen
Ro2 <- lm(Rw$NBI ~ Rw$Row)
anova(Ro2)
## Analysis of Variance Table
## 
## Response: Rw$NBI
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## Rw$Row      49   7866 160.527   2.325 8.14e-07 ***
## Residuals 1742 120273  69.043                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Flavanoids
Ro3 <- lm(Rw$Flav ~ Rw$Row)
anova(Ro3)
## Analysis of Variance Table
## 
## Response: Rw$Flav
##             Df  Sum Sq  Mean Sq F value   Pr(>F)    
## Rw$Row      49   8.215 0.167646   2.865 3.11e-10 ***
## Residuals 1742 101.933 0.058515                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Chlorophyll
Ro4 <- lm(Rw$Chl ~ Rw$Row)
anova(Ro4)
## Analysis of Variance Table
## 
## Response: Rw$Chl
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## Rw$Row      49  21394  436.61  1.9533 0.0001046 ***
## Residuals 1742 389370  223.52                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Block Effects, Combining Row and Columns.

Z = group_by(F1, Tree.ID,Row,Column)
Z1<- summarise(Z, count = n(), Chl = mean(Chl, na.rm=T),NBI = mean(NBI, na.rm=T), Flav = mean(Flav, na.rm = T), Anth = mean(Anth, na.rm=T))

ZChl = Z1[c(2,3,5)] MChl = mean(ZChl\(Chl);MChl ZChl\)Mean = ZChl$Chl-MChl ZChl = ZChl[-c(3)] write.xlsx(as.data.frame(ZChl), file = “Chl.xlsx”, sheetName =“Chl”,col.names = T, row.names = F)

ZNBI = Z1[c(2,3,6)] MNBI = mean(ZNBI\(NBI);MNBI ZNBI\)Mean = ZNBI$NBI-MNBI ZNBI = ZNBI[-c(3)] write.xlsx(as.data.frame(ZNBI), file = “NBI.xlsx”, sheetName =“NBI”,col.names = T, row.names = F)

ZFlav = Z1[c(2,3,7)] MFlav = mean(ZFlav\(Flav);MFlav ZFlav\)Mean = ZFlav$Flav-MFlav ZFlav = ZFlav[-c(3)] write.xlsx(as.data.frame(ZFlav), file = “Flav.xlsx”, sheetName =“Flav”,col.names = T, row.names = F)

ZAnth = Z1[c(2,3,8)] MAnth = mean(ZAnth\(Anth);MAnth ZAnth\)Mean = ZAnth$Anth-MAnth ZAnth = ZAnth[-c(3)] write.xlsx(as.data.frame(ZAnth), file = “Anth.xlsx”, sheetName =“Anth”,col.names = T, row.names = F)

AnthDoc <-read.xlsx("Anth.xlsx", sheetName = "Anth")
heatmaply(AnthDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
ARC <-lm(F1$Anth ~ F1$Row + F1$Column)
anova(ARC)
## Analysis of Variance Table
## 
## Response: F1$Anth
##             Df Sum Sq   Mean Sq F value   Pr(>F)    
## F1$Row      49 0.2346 0.0047878  2.5340 4.26e-08 ***
## F1$Column    1 0.0020 0.0019565  1.0355    0.309    
## Residuals 1741 3.2895 0.0018894                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ChlDoc<-read.xlsx("Chl.xlsx", sheetName = "Chl")
heatmaply(ChlDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
CRC <-lm(F1$Chl ~ F1$Row + F1$Column)
anova(CRC)
## Analysis of Variance Table
## 
## Response: F1$Chl
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## F1$Row      49  21394  436.61  1.9546 0.000103 ***
## F1$Column    1    470  469.95  2.1039 0.147109    
## Residuals 1741 388900  223.38                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
NBIDoc<-read.xlsx("NBI.xlsx", sheetName = "NBI")
heatmaply(NBIDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
NRC <-lm(F1$NBI ~ F1$Row + F1$Column)
anova(NRC)
## Analysis of Variance Table
## 
## Response: F1$NBI
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row      49   7866  160.53  2.3323 7.366e-07 ***
## F1$Column    1    443  443.37  6.4417   0.01123 *  
## Residuals 1741 119830   68.83                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
FlavDoc<-read.xlsx("Flav.xlsx", sheetName = "Flav")
heatmaply(FlavDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
FRC <-lm(F1$Flav ~ F1$Row + F1$Column)
anova(FRC)
## Analysis of Variance Table
## 
## Response: F1$Flav
##             Df  Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row      49   8.215 0.16765  2.9026 1.751e-10 ***
## F1$Column    1   1.379 1.37854 23.8681 1.126e-06 ***
## Residuals 1741 100.554 0.05776                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Block and Height

BHC <-lm(F1$Chl ~ F1$Block+F1$Height)
anova(BHC)
## Analysis of Variance Table
## 
## Response: F1$Chl
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Block     1   3253  3252.9 14.3023 0.0001608 ***
## F1$Height    2    848   423.9  1.8638 0.1553788    
## Residuals 1788 406663   227.4                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
BHF<-lm(F1$Flav ~ F1$Block+F1$Height)
anova(BHF)
## Analysis of Variance Table
## 
## Response: F1$Flav
##             Df  Sum Sq Mean Sq F value    Pr(>F)    
## F1$Block     1   1.251 1.25103 20.7155 5.687e-06 ***
## F1$Height    2   0.917 0.45849  7.5921 0.0005209 ***
## Residuals 1788 107.979 0.06039                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
BHA<-lm(F1$Anth ~ F1$Block+F1$Height)
anova(BHA)
## Analysis of Variance Table
## 
## Response: F1$Anth
##             Df Sum Sq   Mean Sq F value    Pr(>F)    
## F1$Block     1 0.0131 0.0131295  6.7841  0.009274 ** 
## F1$Height    2 0.0525 0.0262745 13.5763 1.407e-06 ***
## Residuals 1788 3.4604 0.0019353                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
BHN<-lm(F1$NBI ~ F1$Block+F1$Height)
anova(BHN)
## Analysis of Variance Table
## 
## Response: F1$NBI
##             Df Sum Sq Mean Sq F value  Pr(>F)    
## F1$Block     1   1540 1540.32  21.771 3.3e-06 ***
## F1$Height    2     98   49.24   0.696  0.4987    
## Residuals 1788 126500   70.75                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Compare Parents

Parent <- rbind(EC201,EC103)
t.test(Parent$Chl ~ Parent$Tree.ID)
## 
##  Welch Two Sample t-test
## 
## data:  Parent$Chl by Parent$Tree.ID
## t = -0.003842, df = 17.804, p-value = 0.997
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -7.830954  7.802387
## sample estimates:
## mean in group EC103 mean in group EC201 
##            52.59242            52.60670
P1 <- lm(Parent$Chl ~ Parent$Tree.ID)
anova(P1)
## Analysis of Variance Table
## 
## Response: Parent$Chl
##                Df Sum Sq Mean Sq F value Pr(>F)
## Parent$Tree.ID  1    0.0   0.001       0 0.9969
## Residuals      20 1461.7  73.087
t.test(Parent$Flav ~ Parent$Tree.ID)
## 
##  Welch Two Sample t-test
## 
## data:  Parent$Flav by Parent$Tree.ID
## t = -1.141, df = 19.612, p-value = 0.2676
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.31409194  0.09215861
## sample estimates:
## mean in group EC103 mean in group EC201 
##            1.599833            1.710800
P2 <-lm(Parent$Flav ~ Parent$Tree.ID)
anova(P2)
## Analysis of Variance Table
## 
## Response: Parent$Flav
##                Df  Sum Sq  Mean Sq F value Pr(>F)
## Parent$Tree.ID  1 0.06717 0.067165  1.2892 0.2696
## Residuals      20 1.04195 0.052098
t.test(Parent$NBI ~ Parent$Tree.ID)
## 
##  Welch Two Sample t-test
## 
## data:  Parent$NBI by Parent$Tree.ID
## t = 0.47573, df = 14.7, p-value = 0.6413
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.076667  7.987334
## sample estimates:
## mean in group EC103 mean in group EC201 
##            33.14333            31.68800
P3<- lm(Parent$NBI ~ Parent$Tree.ID)
anova(P3)
## Analysis of Variance Table
## 
## Response: Parent$NBI
##                Df Sum Sq Mean Sq F value Pr(>F)
## Parent$Tree.ID  1  11.55  11.553  0.2455 0.6256
## Residuals      20 941.01  47.050
t.test(Parent$NBI ~ Parent$Tree.ID)
## 
##  Welch Two Sample t-test
## 
## data:  Parent$NBI by Parent$Tree.ID
## t = 0.47573, df = 14.7, p-value = 0.6413
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.076667  7.987334
## sample estimates:
## mean in group EC103 mean in group EC201 
##            33.14333            31.68800
P4 <-lm(Parent$NBI ~ Parent$Tree.ID)
anova(P4)
## Analysis of Variance Table
## 
## Response: Parent$NBI
##                Df Sum Sq Mean Sq F value Pr(>F)
## Parent$Tree.ID  1  11.55  11.553  0.2455 0.6256
## Residuals      20 941.01  47.050